package com.ddxz.tool.sql.parse.impl;

import com.alibaba.druid.sql.ast.statement.SQLSelectQuery;
import com.alibaba.druid.sql.dialect.postgresql.parser.PGSQLStatementParser;

/**
 * @author 朱宗刚
 * @version 1.0.0
 * @description com.casic.common.com.casic.common.tools.sql.parse.impl.PgSqlParse
 * @date 2020/3/18
 */
public class PgSqlParse extends BaseSqlParse {
    @Override
    public String getLeftQuote() {
        return "\"";
    }

    @Override
    public String getRightQuote() {
        return "\"";
    }

    @Override
    public String getDefaultSchema() {
        return "public";
    }

    @Override
    public SQLSelectQuery initSql(String sql) {
        return new PGSQLStatementParser(sql).parseSelect().getSelect().getQuery();
    }

    private PgSqlParse() {super();}
}
